package com.spark.searchservice.repository;

import com.spark.searchapi.entity.PmsProduct;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

/**
 * @author fuqiang
 * @Description ES搜索
 * @Date 2021-03-05
 */
public interface EsProductRepository extends ElasticsearchRepository<PmsProduct,Long> {
    /**
     * 根据搜索条件查询商品
     * @param name 名称
     * @param subTitle 副标题
     * @param keywords 关键词
     * @param pageRequest 分页
     * @return
     */
    Page<PmsProduct> findByNameOrSubTitleOrKeywords(String name,String subTitle,
                                                    String keywords,PageRequest pageRequest );

}
